package pl.edu.mimuw.irs.rcp.controller.editor.workflow.handler;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CommandStack;

import pl.edu.mimuw.irs.core.model.design.net.IRSNode;
import pl.edu.mimuw.irs.rcp.controller.editor.workflow.command.ExpandCommand;
import pl.edu.mimuw.irs.rcp.controller.editor.workflow.part.IRSNodeEditPart;

public class ExpandHandler extends AbstractMultipleNodesHandler {

	// *** Attributes

	private IRSNodeEditPart nodeEditPart;
	public IRSNodeEditPart getNodeEditPart() {
		return nodeEditPart;
	}
	public void setNodeEditPart(IRSNodeEditPart nodeEditPart) {
		this.nodeEditPart = nodeEditPart;
	}
	
	// *** Methods

	protected Object execute(ExecutionEvent event, CommandStack commandStack, IRSNode node) {
		Command command = new ExpandCommand(node, true);
		commandStack.execute(command);
		return null;
	}
}
